/*
===============================================================================
 Name        : main.c
 Author      : 
 Version     :
 Copyright   : Copyright (C)
 Description : main definition
===============================================================================
*/

#ifdef __USE_CMSIS
#include "LPC11Uxx.h"
#endif

#include <cr_section_macros.h>
#include <NXP/crp.h>
// Variable to store CRP value in. Will be placed automatically
// by the linker when "Enable Code Read Protect" selected.
// See crp.h header for more information
__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;

#include "application.h"
#include "mcu_regs.h"
#include "type.h"
#include "typedefs.h"
#include "timer16.h"
#include "timer32.h"
#include "gpio.h"
#include "ssp.h"
#include "DOGSdisplay.h"
#include "num_conversion.h"

int main(void)
{
	int i = 0;
	int ii = 0;
	GPIOInit();
	init_timer32(1, 10);

	LPC_IOCON->PIO0_7 &= ~0x07;					// set PIO0_7 as a GPIO pin
	GPIOSetDir(0, 7, 1);						// for debug purposes

    initDogs();

	while(1)
	{
//		lcd_string(10,5,"Hello World :)", ptr_font_6x8, DELETE);

/*		GPIOSetBitValue(0, 7, 1);				// blink LED on board
		delay32Ms(1, 300);
		lcd_string(10,5,"              ", ptr_font_6x8, DELETE);

		GPIOSetBitValue(0, 7, 0);
		delay32Ms(1, 100);
		for(i=0; i<255; i++)
		{

		}*/
		ii++;
		lcd_string(10, 20, "ii:      ", ptr_font_6x8, lcd_linkmode);
		lcd_write_U16_hex(30, 22, ii);
		delay32Ms(1, 50);
	}
	return 0 ;
}
